const sql = require('mysql2')
const config = require('../config')
const mysql = sql.createPool({
    host: config().mysql.host,
    user: config().mysql.user,
    password: config().mysql.password,
    database: config().mysql.database,
    port: config().mysql.port
}).promise()


const SqlQuery = () => {
    return {
        login: 'select * from jenkins_user where user=? AND password=?',
        register: 'insert into jenkins_user(user,password,name,phone,avatar,emil,role) values (?,?,?,?,?,?,?)',
        menu: '',
        resource:'',
        UserExeCute:'',
        UserProject:''
    }
}

module.exports = {mysql, SqlQuery}